using System;

namespace TicTacToe.Tests
{
    public static class TestHelpers
    {
        public static bool ThrowsException<TException>(this Action action) where TException : Exception
        {
            try
            {
                action();
            }
            catch (Exception ex)
            {
                return ex.GetType() == typeof(TException);
            }
            return false;
        }
    }
}